package huhx.linux.com.kotlinlearn.adapter

import huhx.linux.com.kotlinlearn.model.User

/**
 * Created by huhx on 2018-03-18 上午 11:23.
 */

object LamdaTest2 {

    fun consumer(success: IConsumer<in User>, error: IConsumer<in Throwable>) {

    }

    fun container(consumer: IContainer<in User>, provider: IContainer<in Throwable>) {

    }

    fun provider(iProvider: IProvider) {

    }

    fun subscribe(success: IConsumer<in User>) {

    }

    @JvmStatic
    fun main(args: Array<String>) {
        consumer(object : IConsumer<User> {
            override fun accept(consumer: User) {

            }
        }, object : IConsumer<Throwable> {
            override fun accept(consumer: Throwable) {

            }
        })

        // 把IProvider的接口改成kotlin，下面的
        provider(IProvider { })

        subscribe(object : IConsumer<User> {
            override fun accept(consumer: User) {

            }
        })

        container(IContainer {

        }, IContainer {

        })
    }
}
